Integrand size = 24, antiderivative size = 105 \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {7 a^2 \sin (c+d x)}{9 d}-\frac {7 a^2 \sin ^3(c+d x)}{9 d}+\frac {7 a^2 \sin ^5(c+d x)}{15 d}-\frac {a^2 \sin ^7(c+d x)}{9 d}-\frac {2 i \cos ^9(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3577, 2713} \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {a^2 \sin ^7(c+d x)}{9 d}+\frac {7 a^2 \sin ^5(c+d x)}{15 d}-\frac {7 a^2 \sin ^3(c+d x)}{9 d}+\frac {7 a^2 \sin (c+d x)}{9 d}-\frac {2 i \cos ^9(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d} \]
[In]
[Out]
Rule 2713
Rule 3577
Rubi steps \begin{align*} \text {integral}& = -\frac {2 i \cos ^9(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}+\frac {1}{9} \left (7 a^2\right ) \int \cos ^7(c+d x) \, dx \\ & = -\frac {2 i \cos ^9(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d}-\frac {\left (7 a^2\right ) \text {Subst}\left (\int \left (1-3 x^2+3 x^4-x^6\right ) \, dx,x,-\sin (c+d x)\right )}{9 d} \\ & = \frac {7 a^2 \sin (c+d x)}{9 d}-\frac {7 a^2 \sin ^3(c+d x)}{9 d}+\frac {7 a^2 \sin ^5(c+d x)}{15 d}-\frac {a^2 \sin ^7(c+d x)}{9 d}-\frac {2 i \cos ^9(c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{9 d} \\ \end{align*}
Time = 0.31 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.99 \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {2 i a^2 \cos ^9(c+d x)}{9 d}+\frac {a^2 \sin (c+d x)}{d}-\frac {5 a^2 \sin ^3(c+d x)}{3 d}+\frac {9 a^2 \sin ^5(c+d x)}{5 d}-\frac {a^2 \sin ^7(c+d x)}{d}+\frac {2 a^2 \sin ^9(c+d x)}{9 d} \]
[In]
[Out]
Time = 135.74 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.25
method | result | size |
derivativedivides | \(\frac {-a^{2} \left (-\frac {\left (\cos ^{8}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{9}+\frac {\left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{63}\right )-\frac {2 i a^{2} \left (\cos ^{9}\left (d x +c \right )\right )}{9}+\frac {a^{2} \left (\frac {128}{35}+\cos ^{8}\left (d x +c \right )+\frac {8 \left (\cos ^{6}\left (d x +c \right )\right )}{7}+\frac {48 \left (\cos ^{4}\left (d x +c \right )\right )}{35}+\frac {64 \left (\cos ^{2}\left (d x +c \right )\right )}{35}\right ) \sin \left (d x +c \right )}{9}}{d}\) | \(131\) |
default | \(\frac {-a^{2} \left (-\frac {\left (\cos ^{8}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{9}+\frac {\left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{63}\right )-\frac {2 i a^{2} \left (\cos ^{9}\left (d x +c \right )\right )}{9}+\frac {a^{2} \left (\frac {128}{35}+\cos ^{8}\left (d x +c \right )+\frac {8 \left (\cos ^{6}\left (d x +c \right )\right )}{7}+\frac {48 \left (\cos ^{4}\left (d x +c \right )\right )}{35}+\frac {64 \left (\cos ^{2}\left (d x +c \right )\right )}{35}\right ) \sin \left (d x +c \right )}{9}}{d}\) | \(131\) |
risch | \(-\frac {i a^{2} {\mathrm e}^{9 i \left (d x +c \right )}}{1152 d}-\frac {i a^{2} {\mathrm e}^{7 i \left (d x +c \right )}}{128 d}-\frac {7 i a^{2} \cos \left (d x +c \right )}{64 d}+\frac {7 a^{2} \sin \left (d x +c \right )}{16 d}-\frac {i a^{2} \cos \left (5 d x +5 c \right )}{32 d}+\frac {11 a^{2} \sin \left (5 d x +5 c \right )}{320 d}-\frac {7 i a^{2} \cos \left (3 d x +3 c \right )}{96 d}+\frac {7 a^{2} \sin \left (3 d x +3 c \right )}{64 d}\) | \(137\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.12 \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {{\left (-5 i \, a^{2} e^{\left (14 i \, d x + 14 i \, c\right )} - 45 i \, a^{2} e^{\left (12 i \, d x + 12 i \, c\right )} - 189 i \, a^{2} e^{\left (10 i \, d x + 10 i \, c\right )} - 525 i \, a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} - 1575 i \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + 945 i \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} + 105 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + 9 i \, a^{2}\right )} e^{\left (-5 i \, d x - 5 i \, c\right )}}{5760 \, d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 314 vs. \(2 (94) = 188\).
Time = 0.39 (sec) , antiderivative size = 314, normalized size of antiderivative = 2.99 \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=\begin {cases} \frac {\left (- 126663739519795200 i a^{2} d^{7} e^{18 i c} e^{9 i d x} - 1139973655678156800 i a^{2} d^{7} e^{16 i c} e^{7 i d x} - 4787889353848258560 i a^{2} d^{7} e^{14 i c} e^{5 i d x} - 13299692649578496000 i a^{2} d^{7} e^{12 i c} e^{3 i d x} - 39899077948735488000 i a^{2} d^{7} e^{10 i c} e^{i d x} + 23939446769241292800 i a^{2} d^{7} e^{8 i c} e^{- i d x} + 2659938529915699200 i a^{2} d^{7} e^{6 i c} e^{- 3 i d x} + 227994731135631360 i a^{2} d^{7} e^{4 i c} e^{- 5 i d x}\right ) e^{- 9 i c}}{145916627926804070400 d^{8}} & \text {for}\: d^{8} e^{9 i c} \neq 0 \\\frac {x \left (a^{2} e^{14 i c} + 7 a^{2} e^{12 i c} + 21 a^{2} e^{10 i c} + 35 a^{2} e^{8 i c} + 35 a^{2} e^{6 i c} + 21 a^{2} e^{4 i c} + 7 a^{2} e^{2 i c} + a^{2}\right ) e^{- 5 i c}}{128} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.13 \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {70 i \, a^{2} \cos \left (d x + c\right )^{9} - {\left (35 \, \sin \left (d x + c\right )^{9} - 135 \, \sin \left (d x + c\right )^{7} + 189 \, \sin \left (d x + c\right )^{5} - 105 \, \sin \left (d x + c\right )^{3}\right )} a^{2} - {\left (35 \, \sin \left (d x + c\right )^{9} - 180 \, \sin \left (d x + c\right )^{7} + 378 \, \sin \left (d x + c\right )^{5} - 420 \, \sin \left (d x + c\right )^{3} + 315 \, \sin \left (d x + c\right )\right )} a^{2}}{315 \, d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 669 vs. \(2 (91) = 182\).
Time = 0.72 (sec) , antiderivative size = 669, normalized size of antiderivative = 6.37 \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=-\frac {18585 \, a^{2} e^{\left (9 i \, d x + 3 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 37170 \, a^{2} e^{\left (7 i \, d x + i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 18585 \, a^{2} e^{\left (5 i \, d x - i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 14625 \, a^{2} e^{\left (9 i \, d x + 3 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) + 29250 \, a^{2} e^{\left (7 i \, d x + i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) + 14625 \, a^{2} e^{\left (5 i \, d x - i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 18585 \, a^{2} e^{\left (9 i \, d x + 3 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 37170 \, a^{2} e^{\left (7 i \, d x + i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 18585 \, a^{2} e^{\left (5 i \, d x - i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 14625 \, a^{2} e^{\left (9 i \, d x + 3 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 29250 \, a^{2} e^{\left (7 i \, d x + i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 14625 \, a^{2} e^{\left (5 i \, d x - i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 3960 \, a^{2} e^{\left (9 i \, d x + 3 i \, c\right )} \log \left (i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) - 7920 \, a^{2} e^{\left (7 i \, d x + i \, c\right )} \log \left (i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) - 3960 \, a^{2} e^{\left (5 i \, d x - i \, c\right )} \log \left (i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) + 3960 \, a^{2} e^{\left (9 i \, d x + 3 i \, c\right )} \log \left (-i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) + 7920 \, a^{2} e^{\left (7 i \, d x + i \, c\right )} \log \left (-i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) + 3960 \, a^{2} e^{\left (5 i \, d x - i \, c\right )} \log \left (-i \, e^{\left (i \, d x\right )} + e^{\left (-i \, c\right )}\right ) + 80 i \, a^{2} e^{\left (18 i \, d x + 12 i \, c\right )} + 880 i \, a^{2} e^{\left (16 i \, d x + 10 i \, c\right )} + 4544 i \, a^{2} e^{\left (14 i \, d x + 8 i \, c\right )} + 15168 i \, a^{2} e^{\left (12 i \, d x + 6 i \, c\right )} + 45024 i \, a^{2} e^{\left (10 i \, d x + 4 i \, c\right )} + 43680 i \, a^{2} e^{\left (8 i \, d x + 2 i \, c\right )} - 18624 i \, a^{2} e^{\left (4 i \, d x - 2 i \, c\right )} - 1968 i \, a^{2} e^{\left (2 i \, d x - 4 i \, c\right )} - 6720 i \, a^{2} e^{\left (6 i \, d x\right )} - 144 i \, a^{2} e^{\left (-6 i \, c\right )}}{92160 \, {\left (d e^{\left (9 i \, d x + 3 i \, c\right )} + 2 \, d e^{\left (7 i \, d x + i \, c\right )} + d e^{\left (5 i \, d x - i \, c\right )}\right )}} \]
[In]
[Out]
Time = 6.13 (sec) , antiderivative size = 330, normalized size of antiderivative = 3.14 \[ \int \cos ^9(c+d x) (a+i a \tan (c+d x))^2 \, dx=\frac {2\,a^2\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2{}\mathrm {i}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {1024\,a^2\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )}{9\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^9}-\frac {8\,a^2\,\left (5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-12{}\mathrm {i}\right )}{3\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^2}-\frac {512\,a^2\,\left (8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-9{}\mathrm {i}\right )}{9\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^8}+\frac {128\,a^2\,\left (19\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-24{}\mathrm {i}\right )}{3\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^7}-\frac {64\,a^2\,\left (19\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-35{}\mathrm {i}\right )}{5\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^4}+\frac {56\,a^2\,\left (19\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-40{}\mathrm {i}\right )}{15\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^3}-\frac {128\,a^2\,\left (59\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-84{}\mathrm {i}\right )}{9\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^6}+\frac {32\,a^2\,\left (781\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1260{}\mathrm {i}\right )}{45\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^5} \]
[In]
[Out]